#ifndef __DAT_W32_H__
#define __DAT_W32_H__

//#define WIN32_LEAN_AND_MEAN
#include <WinSock2.h>
#include <Windows.h>

#include <Mswsock.h>
#include <WS2tcpip.h>
#include <WinError.h>

#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "Mswsock.lib")
#pragma comment( lib,"winmm.lib" )

#define EWOULDBLOCK WSAEWOULDBLOCK

#ifndef __attribute__
#define __attribute__(x)
#endif

#ifndef __func__
#define __func__ __FUNCDNAME__
#endif

#define net_accept accept
#define net_read(s, b, c)  recv(s, b, c, 0)
#define net_write(s, b, c) send(s, b, c, 0)
#define net_close closesocket
#define net_writev  writev

struct iovec {
	void* iov_base; /* Starting address */
	size_t iov_len; /* Length in bytes */
};


int writev(int fd, struct iovec* iov, int iovlen);


//#if !defined snprintf
//#define snprintf _snprintf
//#endif

#endif